package com.kantboot.business.gc.service.impl;

import com.kantboot.business.gc.domain.dto.BusGcTypeSearchDTO;
import com.kantboot.business.gc.domain.entity.BusGcType;
import com.kantboot.business.gc.repository.BusGcTypeRepository;
import com.kantboot.business.gc.service.IBusGcTypeService;
import com.kantboot.util.core.param.PageParam;
import com.kantboot.util.core.result.PageResult;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BusGcTypeServiceImpl implements IBusGcTypeService {

    @Resource
    private BusGcTypeRepository repository;

    @Override
    public List<BusGcType> getAll() {
        return repository.findAll();
    }

    @Override
    public PageResult getBodyData(PageParam<BusGcTypeSearchDTO> pageParam) {
        return PageResult.of(repository.getBodyData(pageParam.getData(), pageParam.getPageable()));
    }
}
